//
//  ConsultingChatViewController.h
//  安好
//
//  Created by 冯凯 on 14-8-26.
//  Copyright (c) 2014年 冯凯. All rights reserved.
//

#import "BaseViewController.h"
#import <AVFoundation/AVFoundation.h>
#import <AudioToolbox/AudioToolbox.h>
#import "SRWebSocket.h"
#import "JSMessageInputView.h"
#import "JSMessagesViewController.h"
#import "ConsultQuestionView.h"
#import "QinKeyBoardController.h"
#import "OverView.h"
#import "PictureViewController.h"

/**
 枚举（消息的类型） 1=传送的时文本信息  2=传送的时图片信息  3=传送的时音频
 */
enum kWCMessageType {
    kWCMessageTypeText = 1,
    kWCMessageTypeImage = 2,
    kWCMessageTypeVoice = 3,
};

/**
 判断消息方向是接收还是发送的（对应消息的方向）
 */
enum kWCMessageDirection {
    kwCMessageDirectionStill=0,
    kWCMessageDirectionOut = 1,
    kWCMessageDirectionIn = 2,
};
/**
 *  判断进入聊天界面的几个途径 0=和同行聊天，1=和医生聊天。
 */
enum kWCEnterIntoConsultChat{
    kWCEnterIntoConsultChatPeer=0,
    kWCEnterIntoConsultChatNoPeer=1,
};
@interface ConsultingChatViewController : BaseViewController<UITextViewDelegate, UIGestureRecognizerDelegate, UITableViewDataSource, UITableViewDelegate, UIActionSheetDelegate, UIImagePickerControllerDelegate,UINavigationControllerDelegate, AVAudioRecorderDelegate, AVAudioPlayerDelegate,PictureViewControllerDelegate>
//发送  语音  相机  所在的view
{
    BOOL voiceShow;
    CGSize tempKeysize;
    int page;
    BOOL isRecoreding;
    BOOL isCancel;
    NSInteger voicetag;
    CGPoint point_begain;
//录音动画计时器
    NSTimer *timer;
}
@property (strong, nonatomic) UIView *toolview;
@property (strong, nonatomic) UITextView *messageTextview;
@property (strong, nonatomic) UIButton *sendMessageButton;
@property (strong, nonatomic) UIButton *photoButton;
@property (strong, nonatomic) UIButton *voiceButton;
@property (strong, nonatomic) UIButton *longTapVoiceButton;
@property (strong, nonatomic) UIImageView *imageView;
@property (strong, nonatomic) AVAudioRecorder *recorder;
@property (strong, nonatomic) AVAudioPlayer *avPlay;
@property (strong, nonatomic) AVAudioPlayer *avPlay2;
@property (strong, nonatomic) AVAudioPlayer *sendPlay;
@property (strong, nonatomic) NSDictionary * dataDic;
@property (strong, nonatomic) NSString * doctoruid;
@property (strong, nonatomic) NSString * qid;
@property (strong, nonatomic) NSString * userName;
@property (strong, nonatomic) NSMutableArray *dataArray;
@property (strong, nonatomic) NSString * titeleString;
@property (strong, nonatomic) NSString * touid;
@property (strong, nonatomic) NSString * toTpye;
@property (strong, nonatomic) NSString * toUserImage;
@property (strong, nonatomic) NSString *voiceLength;
//@property (strong, nonatomic) IBOutlet UITableView *tableView;
@property (strong, nonatomic)  UITableView *tableView;
//@property (nonatomic, assign) BOOL isFromPeer;
//@property (nonatomic, assign) BOOL isFromNoPeer;
@property (strong, nonatomic) NSString * toMed;
@property (strong, nonatomic) NSMutableArray *reportArray;
//是否是从投诉界面进来的
@property (nonatomic, assign) BOOL isFromReport;

@property (nonatomic,assign) BOOL isFir;
@property (strong, nonatomic) NSString * good;

@property (nonatomic,assign) BOOL loadNewPage;

@property (nonatomic,assign) BOOL isOver;
@property (strong, nonatomic) NSString *doctorid;

@property (strong, nonatomic) JSMessageInputView *inputToolBarView;
@property (assign, nonatomic) CGFloat previousTextViewContentHeight;


@property (strong, nonatomic) NSString *currentPicWidth;
@property (strong, nonatomic) NSString *currentPicHeight;

@property (strong, nonatomic) UIImage * conImage;

//***************************修改后***********************//
/**
 *  判断进入聊天界面的几个途径(患友/医生)；
 */
@property (assign, nonatomic) NSInteger isFromwhere;
@property (strong, nonatomic) ConsultQuestionView *questionView;
@property (strong, nonatomic) QinKeyBoardController *keyboardController;
@property (strong, nonatomic) OverView *overView;
@property (assign, nonatomic) BOOL isFromConsult;
@property (assign, nonatomic) BOOL isAssin;

@property (strong, nonatomic) NSDictionary *RelatedDic;
@property (strong, nonatomic) NSDictionary *ConsultDic;
@property (assign, nonatomic) CGPoint CurrentContentOffSize;
@property (nonatomic, strong) PictureViewController *picViewController;

@property (nonatomic, strong) NSString *questionMessage;

@property (strong, nonatomic) NSString *consultType;
@property (strong, nonatomic) NSString *selfOver;
@end
